<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="UTF-8">
  <title>JavaScript 字符串方法 </title>
</head>
<body>
<h2>字符串长度</h2>

<p id="demo"></p>

<script>
  var txt = "The full name of China is the People's Republic of China.";
  document.getElementById("demo").innerHTML = txt.length;
</script>

</body>
</html>